package com.wpw.dream.net.dubbo.action;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.wpw.dream.dubbo.rest.entry.User;
import com.wpw.dream.dubbo.rest.service.RestService;

@Controller
@RequestMapping("dubboRest")
public class DubboRestAction {
	
	@Autowired
	private RestService restService;
	
	/*@Autowired
	private IpService ipService;*/
	
	@RequestMapping("rest")
	@ResponseBody
	public Object rest(Long id) {
		User returnXml = restService.returnXml(id);
		return returnXml;
	}
	
	@RequestMapping("rest2")
	@ResponseBody
	public Object rest2(Long id) {
		Object json = restService.returnJson(id);
		return json;
	}

	/*@RequestMapping("rest3")
	@ResponseBody
	public Object rest3(String ip) {
		RestResponse<IpInfoResult> ipInfo = ipService.ipInfo(ip);
		if (ipInfo.getSuccess()) {
			
			IpInfoResult result = ipInfo.getResult();
			return result;
		}
		return ipInfo.getErrorResult();
	}*/

}
